maqueenPlusV2.I2CInit()
basic.forever(function () {
    serial.writeLine("Turn on the left light, motor forward, RGB light red")
    maqueenPlusV2.controlMotor(maqueenPlusV2.MyEnumMotor.AllMotor, maqueenPlusV2.MyEnumDir.Forward, 100)
    maqueenPlusV2.controlLED(maqueenPlusV2.MyEnumLed.LeftLed, maqueenPlusV2.MyEnumSwitch.Open)
    basic.pause(2000)
    serial.writeLine("Turn on the right side light, motor back, RGB light yellow")
    maqueenPlusV2.controlMotor(maqueenPlusV2.MyEnumMotor.AllMotor, maqueenPlusV2.MyEnumDir.Backward, 100)
    maqueenPlusV2.controlLED(maqueenPlusV2.MyEnumLed.LeftLed, maqueenPlusV2.MyEnumSwitch.Close)
    maqueenPlusV2.controlLED(maqueenPlusV2.MyEnumLed.RightLed, maqueenPlusV2.MyEnumSwitch.Open)
    basic.pause(2000)
    serial.writeLine("Turn on the side lights, motor forward, RGB light green")
    maqueenPlusV2.controlMotor(maqueenPlusV2.MyEnumMotor.AllMotor, maqueenPlusV2.MyEnumDir.Forward, 100)
    maqueenPlusV2.controlLED(maqueenPlusV2.MyEnumLed.AllLed, maqueenPlusV2.MyEnumSwitch.Open)
    basic.pause(2000)
    serial.writeLine("Printing sensor data")
    serial.writeLine("SensorL1 status:" + maqueenPlusV2.readLineSensorState(maqueenPlusV2.MyEnumLineSensor.SensorL1))
    serial.writeLine("SensorL1 ADC:" + maqueenPlusV2.readLineSensorData(maqueenPlusV2.MyEnumLineSensor.SensorL1))
    serial.writeLine("ultrasonic sensor:" + maqueenPlusV2.readUltrasonic(DigitalPin.P13, DigitalPin.P14))
})
